package cn.edu.scau.cmi.zhangjunming.composite.consisentPersion;

import java.util.HashSet;
import java.util.Set;

public abstract class ConsistentComponent {
   
	//父节点
	ConsistentComponent parent = null;
	public int type;
	
	//子节点作为其组成成员
	Set<ConsistentComponent> children = new HashSet<ConsistentComponent>();
	
	//业务功能
	abstract String doSomething();
	
	//获取父节点功能
	abstract ConsistentComponent getParent();
	
	//设置父节点功能
	abstract void setParent(ConsistentComponent parent);
	
	//加子节点功能
	public abstract ConsistentComponent addChild(ConsistentComponent child);
	
	//删除节点
	abstract ConsistentComponent deliete(ConsistentComponent child);
	
	//获取子节点功能
	public abstract Set<ConsistentComponent> getChild();
	
	public abstract int getType();
	
	public abstract void setType();

}
